#include <bits/stdc++.h>
// 2025/03/11
// tag: 
// Author: Forever
using namespace std;

using int64 = int64_t;
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--){
        int n;
        cin >> n;
        if (n == 1 || n == 3){
            cout << "-1" << endl;
        }
        else if (n % 2 == 1){
            for (int i = 1; i <= n - 5; i++)
                cout << 3;
            cout << 36366 << endl;
        }
        else{
            for (int i = 1; i <= n - 2; i++)
                cout << 3;
            cout << 66 << endl;
        }
    }
    return 0;
}